* STATA command file generated by EUGene  3.20 to read data file
* "\\psf\Home\Documents\EUGene_Output\12-05-28_dyad.out"
* To execute this command file: 
*    1) Run STATA,
*    2) "cd" to directory "\\psf\Home\Documents\EUGene_Output\",
*    3) enter command "do 12-05-28_dyad.out.do".

* Number of observations in this data set: 805239

* Data set specifications:
*   Base Format: Non-directed Dyad
*   Time Span: 1816 to 2008
*   Selected Subset: All dyads included)
*   Sampling: None (100% of available data written to file)
*   Variables included:
*        ccode1	ccode2	year	abbrev1	abbrev2	cap_1	cap_2	milper_1	milex_1	energy_1	irst_1	upop_1	tpop_1	milper_2	milex_2	energy_2	irst_2	upop_2	tpop_2	majpow1	majpow2	rlreg12	rlreg21	contig	distance	numstate	numGPs	cwongo	cwongonm	cwmid	cwmidnm	cwdynm	cwhost1	cwhost2	cwhostd	cwkeynum	cworig1	cworig2	cwmidnme	cwstmo1	cwstday1	cwstyr1	cwstmo2	cwstday2	cwstyr2	cwendmo1	cwenddy1	cwendyr1	cwendmo2	cwenddy2	cwendyr2	cwrevt11	cwrevt21	cwrevt12	cwrevt22	cwfatal1	cwfatex1	cwfatal2	cwfatex2	cwhiact1	cwhiact2	cwhiactd	cwoutcm	cwsettle	cwfatald	cwrecip	cwnumst1	cwnumst2	cwpceyrs	democ1	democ2	autoc1	autoc2	polity1	polity2	polity21	polity22
*   Selected settings for variables with multiple output options:
*        Distance variable measured using capitol coordinates and land contiguity, including modifications from The War Trap
*        Peace years calculated using Werner peace year adjustment
*       Dispute characteristics:
*        When two or more disputes occur in a year, data is from the highest intensity dispute
*        Disputes marked for originators only
*        All dyad-years with an ongoing MID dropped
*        Ongoing dispute years not considered new initiations
*        Joiner Dyads included

* Note:  EUGene draws on datasets originally published elsewhere by other scholars.  When 
* presenting analysis using data generated by EUGene, please cite the original data sources 
* as well as EUGene (see EUGene documentation, Appendix D) 
*
* Bibliography for this data set:
* Beck, Nathaniel, Jonathan Katz, and Richard Tucker.  1997.  "Taking Time Seriously:  Time-Series - Cross-Section Analysis with a Binary Dependent Variable."  American Journal of Political Science 42 (October); 1260-1288.
* Bueno de Mesquita, Bruce.  1981.  The War Trap.  New Haven: Yale University Press.
* Jones, Daniel M., Stuart A. Bremer and J. David Singer 1996.  "Militarized Interstate Disputes, 1816-1992: Rationale, Coding Rules, and Empirical Patterns."   	Conflict Management and Peace Science 15(2); 163:213.
* Small, Melvin, and J. David Singer.  1969.  "Formal Alliances, 1815-1965:  An Extension of the Basic Data."  Journal of Peace Research 6: 257-282.  
* Werner, Suzanne.  2000.  "The Effects of Political Similarity on the Onset of Militarized Disputes, 1816-1985."  Political Research Quarterly 53(2): 343-374.
* 
* 
* Marshall, Monty G. and Keith Jaggers. 2002. Polity IV Project: Political Regime Characteristics and Transitions, 1800-2002. http://www.cidcm.umd.edu/inscr/polity/index.htm.

#delimit ;
clear;
set memory 268421k;
infile int ccode1 int ccode2 int year str3 abbrev1 str3 abbrev2 float cap_1 float cap_2 float milper_1 float milex_1 float energy_1 float irst_1 float upop_1 float tpop_1 float milper_2 float milex_2 float energy_2 float irst_2 float upop_2 float tpop_2 byte majpow1 byte majpow2 byte rlreg12 byte rlreg21 byte contig float distance int numstate int numGPs int cwongo int cwongonm int cwmid int cwmidnm int cwdynm int cwhost1 int cwhost2 byte cwhostd int cwkeynum byte cworig1 byte cworig2 str40 cwmidnme int cwstmo1 int cwstday1 int cwstyr1 int cwstmo2 int cwstday2 int cwstyr2 int cwendmo1 int cwenddy1 int cwendyr1 int cwendmo2 int cwenddy2 int cwendyr2 byte cwrevt11 byte cwrevt21 byte cwrevt12 byte cwrevt22 int cwfatal1 int cwfatex1 int cwfatal2 int cwfatex2 byte cwhiact1 byte cwhiact2 byte cwhiactd byte cwoutcm byte cwsettle int cwfatald byte cwrecip int cwnumst1 int cwnumst2 int cwpceyrs long democ1 long democ2 long autoc1 long autoc2 long polity1 long polity2 long polity21 long polity22  using "12-05-28_dyad.out";

* The next command drops the case that was read 
*  if the user included a line of variable names;

drop if missing(ccode1) | missing(year);

* Interpret missing values; 
mvdecode ccode1 ccode2 year abbrev1 abbrev2 cap_1 cap_2 milper_1 milex_1 energy_1 irst_1 upop_1 tpop_1 milper_2 milex_2 energy_2 irst_2 upop_2 tpop_2 majpow1 majpow2 rlreg12 rlreg21 contig distance numstate numGPs cwongo cwongonm cwmid cwmidnm cwdynm cwhost1 cwhost2 cwhostd cwkeynum cworig1 cworig2 cwmidnme cwstmo1 cwstday1 cwstyr1 cwstmo2 cwstday2 cwstyr2 cwendmo1 cwenddy1 cwendyr1 cwendmo2 cwenddy2 cwendyr2 cwrevt11 cwrevt21 cwrevt12 cwrevt22 cwfatal1 cwfatex1 cwfatal2 cwfatex2 cwhiact1 cwhiact2 cwhiactd cwoutcm cwsettle cwfatald cwrecip cwnumst1 cwnumst2 cwpceyrs , mv(-9);
mvdecode democ1, mv(-99);
mvdecode democ2, mv(-99);
mvdecode autoc1, mv(-99);
mvdecode autoc2, mv(-99);
mvdecode polity1, mv(-99);
mvdecode polity2, mv(-99);
mvdecode polity21, mv(-99);
mvdecode polity22, mv(-99);

* Variable labels where available (see EUGeneDocumentation.doc for full information); 
label variable ccode1 "COW CCode Num for state 1";
label variable ccode2 "COW CCode Num for state 2";
label variable year "Year of observation";
label variable abbrev1 "Country Abbreviation state 1";
label variable abbrev2 "Country Abbreviation state 2";
label variable cap_1 "National Capabilities Index (CINC) for cc1";
label variable cap_2 "National Capabilities Index (CINC) for cc2";
label variable milper_1 "COW military personnel for cc1";
label variable milex_1 "COW military expenditure for cc1";
label variable energy_1 "COW energy production for cc1";
label variable irst_1 "COW iron/steel production for cc1";
label variable upop_1 "COW nominal urban population for cc1";
label variable tpop_1 "COW nominal total population for cc1";
label variable milper_2 "COW military personnel for cc2";
label variable milex_2 "COW military expenditure for cc2";
label variable energy_2 "COW energy production for cc2";
label variable irst_2 "COW iron/steel production for cc2";
label variable upop_2 "COW nominal urban population for cc2";
label variable tpop_2 "COW nominal total population for cc2";
label variable majpow1 "Major power status of cc1";
label variable majpow2 "Major power status of cc2";
label variable rlreg12 "Region relevant to Directed Dyad cc1 vs. cc2";
label variable rlreg21 "Region relevant to Directed Dyad cc2 vs. cc1";
label variable contig "Direct contig (1=Lnd, 2=1-12 miles watr, 3=13-24, 4=25-150, 5=151-400, 6=not)";
label variable distance "Distance, from cc1 to cc2, in miles";
label variable numstate "Number of states in intl system as defined by COW system membership";
label variable numGPs "Num of great powers in the international system";
label variable cwongo "A MID was ongoing at the beginning of this year, COW MID data";
label variable cwongonm "Num of the MID that was ongoing at the beginning of the year, if any";
label variable cwmid "MID Onset:  A MID occurred betw cc1 and cc2 in year (0=no, 1=yes).  ";
label variable cwmidnm "Num of the new MID that began in this year, if any;  marks dispute ONSET";
label variable cwdynm "Dyadic MID number (new number for each dyad-episode within each MID)";
label variable cwhost1 "Relevant hostility level reached by cc1 in a MID vs. cc2 in this year";
label variable cwhost2 "Relevant hostility level reached by cc2 in a MID vs. cc1 in this year";
label variable cwhostd "Overall dispute hostility level (0 to 5, as in hostlev1)";
label variable cwkeynum "Key MID number: Num of MID for which other MID variables are reported.  ";
label variable cworig1 "cc1 is originator of the key MID, i.e. is involved on first day (0=no, 1=yes)";
label variable cworig2 "cc2 is originator of the key MID (0=no, 1=yes)";
label variable cwmidnme "Name of the MID identified in cwkeynum, if one has been designated by COW.";
label variable cwstmo1 "MID start month for cc1";
label variable cwstday1 "MID start day for cc1";
label variable cwstyr1 "MID start year for cc1";
label variable cwstmo2 "MID start month for cc2";
label variable cwstday2 "MID start day for cc2";
label variable cwstyr2 "MID start year for cc2";
label variable cwendmo1 "MID end month for cc1";
label variable cwenddy1 "MID end day for cc1";
label variable cwendyr1 "MID end year for cc1";
label variable cwendmo2 "MID end month for cc2";
label variable cwenddy2 "MID end day for cc2";
label variable cwendyr2 "MID end year for cc2";
label variable cwrevt11 "Revision Type 1 for CCode1 (0=n/a, 1=territory, 2=policy, 3=regime, 4=other)";
label variable cwrevt21 "Revision Type 2, State 1, when present in COW v3.0 data (missing pre 1992)";
label variable cwrevt12 "Revision Type 1, State 2";
label variable cwrevt22 "Revision Type 2, State 2, when present in COW v3.0 data.";
label variable cwfatal1 "Fatality level for cc1";
label variable cwfatex1 "Exact estimate of fatalities for cc1, if estimated in MID v3.0.";
label variable cwfatal2 "Fatality level for cc2 (0 to 6, as in fatal1)";
label variable cwfatex2 "Exact estimate of fatalities for cc2, if estimated in MID v3.0.";
label variable cwhiact1 "Highest action by cc1 in dispute (see MID B codebook)";
label variable cwhiact2 "Highest action by cc2 in dispute (see MID B codebook)";
label variable cwhiactd "Highest action in dispute (see MID A codebook)";
label variable cwoutcm "Overall dispute outcome (see MID A codebook)";
label variable cwsettle "Overall MID settlement (1=negotiated, 2=imposed, 3=none, 4=unclear, -9=missing)";
label variable cwfatald "Overall dispute fatality level (cow data)";
label variable cwrecip "Reciprocated dispute (0=no, 1=yes)";
label variable cwnumst1 "Num of states on cc1s side";
label variable cwnumst2 "Num of states on cc2s side";
label variable cwpceyrs "Peace Years, based on MIDs occurrence in COW dyadic MID set";

compress;
